#ifndef SYSTEM_HPP_
#define SYSTEM_HPP_

#include <exception>

#include "utils.hpp"
#include "tree.hpp"
#include "game.hpp"
#include "unionFind.hpp"
#include "hashTable.hpp"

class SystemException : public std::exception {};
class InvalidInputException : public SystemException {};
class FailureException : public SystemException {};

class System {
	int numOfCompanies;
	AvlTree<Game> ratedGames;
	HashTable games;
	UnionFind companies;
    
public:
    System(int numOfCompanies);

	void addGame(ID gameId, ID companyId, int rate);
	void removeGame(ID gameId);
	int getGameCompany(ID gameId);
	void mergeCompanies(ID into, ID from);
	int getMinIdGameOfRate (int minRate);
};

#endif /* SYSTEM_HPP_ */
